Skip to content

feat(webapp): support vercel prod deploy with dev/prod gating#72

Merged
dev-jodee merged 4 commits intomainfrom
feat/webapp-vercel-deploy
Apr 30, 2026
Merged

feat(webapp): support vercel prod deploy with dev/prod gating#72
dev-jodee merged 4 commits intomainfrom
feat/webapp-vercel-deploy

Conversation

@dev-jodee
Copy link
Copy Markdown
Collaborator

Summary

  • Add webapp/vercel.json and static network config so the webapp can deploy to Vercel without the local dev api server
  • Lazy-load Setup + Program routes; render only when import.meta.env.DEV (prod build excludes them from the active route table)
  • useNetworkConfig falls back to static config in DEV and uses static-only in PROD; SetupGuard no-ops when VITE_LOCALNET_USDC_MINT is set
  • New just dev-local recipe bootstraps surfpool + program + mock USDC and writes webapp/.env.local, so contributors can skip the api server entirely
  • ESLint: ignore .claude/ and .git/ (was scanning worktree copies of deleted apps/)

Test Plan

  • pnpm --filter @subscriptions/client build && pnpm --filter webapp build → succeeds
  • just lint-check → passes
  • just fmt-check → passes
  • Vercel: import repo, set Root Directory webapp, deploy → static config picks up devnet program ID + USDC mint
  • Local CLI path: just dev-local && pnpm --filter webapp dev → loads localnet config from .env.local, skips setup wizard
  • Local api path: pnpm --filter subscriptions-api dev & pnpm --filter webapp dev → setup wizard still runs as before

- vercel.json for Vite + pnpm workspace builds
- static network config (config/networks.ts); localnet from env vars
- lib/cluster.ts decouples clusterIdToNetwork from api-client
- lazy-load Setup + Program routes, render only when DEV
- useNetworkConfig falls back to static; PROD never hits api
- SetupGuard no-ops in PROD or when localnet env vars present
- just dev-local bootstraps surfpool + USDC mint + .env.local
- gitignore .env.local
prettier ignore + gitignore for editor/tool configs that vary per dev.
eslint was scanning worktrees under .claude/ and flagging deleted apps/.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 30, 2026

Compute Unit Report

Instruction Samples Min CUs Max CUs Avg CUs Est Cost (Low) [SOL] Est Cost (Med) [SOL] Est Cost (High) [SOL]
cancel_subscription 11 1805 2118 2003 0.000005000 0.000005080 0.000006001
close_subscription_authority 7 1881 1916 1886 0.000005000 0.000005075 0.000005943
create_fixed_delegation 38 3621 9649 5071 0.000005001 0.000005202 0.000007535
create_plan 84 3540 12553 5204 0.000005001 0.000005208 0.000007602
create_recurring_delegation 27 3640 12645 5646 0.000005001 0.000005225 0.000007823
delete_plan 8 416 416 416 0.000005000 0.000005016 0.000005208
init_subscription_authority 142 7431 22851 12036 0.000005003 0.000005481 0.000011018
revoke_delegation 19 318 585 420 0.000005000 0.000005016 0.000005210
subscribe 21 6666 12690 8319 0.000005002 0.000005332 0.000009159
transfer_fixed 6 10105 14605 11854 0.000005003 0.000005474 0.000010927
transfer_recurring 17 10212 14803 11925 0.000005003 0.000005477 0.000010962
transfer_subscription 10 10446 12008 10800 0.000005003 0.000005432 0.000010400
update_plan 21 424 500 474 0.000005000 0.000005018 0.000005237

Generated: 2026-04-30

Replace setup-only NetworkButton with a dropdown using
useCluster().setCluster() so users can switch between devnet, mainnet,
testnet (and localnet in DEV) without going through the setup wizard.
Mainnet RPC defaults to public endpoint, overridable via
VITE_MAINNET_RPC_URL. "Rerun setup" stays available in DEV.
@dev-jodee dev-jodee merged commit 138c2a0 into main Apr 30, 2026
8 checks passed
@dev-jodee dev-jodee deleted the feat/webapp-vercel-deploy branch April 30, 2026 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant